<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="tag" uri="http://library/welcome" %>
<html>

<head>
    <title>首页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/asserts/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/asserts/css/common.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/asserts/css/home.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/asserts/css/welcomeCss.css?v1">
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/asserts/js/bootstrap.min.js"></script>
</head>

<body>
<%@ include file="../../asserts/common/header.jsp" %>
<c:if test="${not empty sessionScope.welcome}">
    <tag:welcome/>
    <c:remove var="welcome" scope="session"/>
</c:if>
<br>
<div class="adminLogin">
    <a href="<c:url value="/admin/login"/>" class="adminLogin a">
        <button class="btn btn-primary">切换管理员账号登录</button>
    </a>
</div>
<br>
<div class="change-account">
    <a href="<c:url value="/changeAccount"/>" class="change-account a">
        <button class="btn btn-primary">切换登录账号</button>
    </a>
</div>
<div class="container">
    <h2 class="text-center">图书管理系统首页</h2>
    <c:if test="${not empty param.message}">
        <div class="alert alert-info">${param.message}</div>
    </c:if>
    <div class="container" style="margin-top:16px;">
        <div id="bookCarousel" class="carousel slide" data-ride="carousel">
            <ol class="carousel-indicators">
                <li data-target="#bookCarousel" data-slide-to="0" class="active"></li>
                <li data-target="#bookCarousel" data-slide-to="1"></li>
                <li data-target="#bookCarousel" data-slide-to="2"></li>
            </ol>
            <div class="carousel-inner" role="listbox" style="border-radius:8px; overflow:hidden;">
                <div class="item active">
                    <img src="${pageContext.request.contextPath}/asserts/images/book1.jpg" alt="book1" class="big-icon">
                </div>
                <c:forEach var="i" begin="2" end="17">
                    <div class="item">
                        <img src="${pageContext.request.contextPath}/asserts/images/book${i}.jpg" alt="book${i}"
                             class="big-icon">
                    </div>
                </c:forEach>
            </div>

        </div>
    </div>
    <div class="row" style="margin-top: 24px;">
        <div class="col-md-12">
            <div class="list-group-grid">
                <a class="list-group-item list-group-item-action grid-card"
                   href="${pageContext.request.contextPath}/bookController/category">
                    <img src="${pageContext.request.contextPath}/asserts/images/books.png" alt="books"
                         class="grid-card-icon">
                    <div class="grid-card-title">图书列表</div>
                </a>
                <a class="list-group-item list-group-item-action grid-card"
                   href="${pageContext.request.contextPath}/borrowRequest">
                    <img src="${pageContext.request.contextPath}/asserts/images/borrowRequ.png" alt="borrow"
                         class="grid-card-icon">
                    <div class="grid-card-title">借阅请求列表</div>
                </a>
                <a class="list-group-item list-group-item-action grid-card"
                   href="${pageContext.request.contextPath}/borrowCart">
                    <img src="${pageContext.request.contextPath}/asserts/images/cart.jpg" alt="admin"
                         class="grid-card-icon">
                    <div class="grid-card-title">我的借阅车</div>
                </a>
                <c:if test="${sessionScope.role == 'admin'}">
                    <a class="list-group-item list-group-item-action grid-card"
                       href="${pageContext.request.contextPath}/adminList">
                        <img src="${pageContext.request.contextPath}/asserts/images/user.png" alt="admin"
                             class="grid-card-icon">
                        <div class="grid-card-title">管理员列表</div>
                    </a>
                    <a class="list-group-item list-group-item-action grid-card"
                       href="${pageContext.request.contextPath}/userList">
                        <img src="${pageContext.request.contextPath}/asserts/images/user.png" alt="user"
                             class="grid-card-icon">
                        <div class="grid-card-title">用户列表</div>
                    </a>
                    <a class="list-group-item list-group-item-action grid-card"
                       href="${pageContext.request.contextPath}/bookController/categoryEdit">
                        <img src="${pageContext.request.contextPath}/asserts/images/bookEedit.png" alt="edit"
                             class="grid-card-icon">
                        <div class="grid-card-title">图书编辑</div>
                    </a>
                </c:if>
            </div>
        </div>
    </div>
</div>
<script src="${pageContext.request.contextPath}/asserts/js/utils/dynamicBG.js"></script>
<c:if test="${not empty borrowMsg}">
    <script>
        alert("${borrowMsg}");
    </script>
</c:if>
<%@ include file="../../asserts/common/footer.jsp" %>
</body>

</html>